﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Events;
using CorpAbreu.Common;
using Microsoft.Practices.Prism.Regions;

namespace CorpAbreu.Login
{
    public class LoginModule : IModule
    {

        private readonly IUnityContainer _container;
        private readonly IEventAggregator _eventAggregator;
        private readonly IRegionManager _regionManager;

        public LoginModule(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            _container = container;
            _eventAggregator = eventAggregator;
            _regionManager = regionManager;
        }

        public void Initialize()
        {
            //throw new NotImplementedException();
            //_eventAggregator.GetEvent<ChangeUserSelected>().Subscribe(ShowDialogUser, true);


            _regionManager.RegisterViewWithRegion("MainWindow", typeof(CorpAbreu.Login.Views.Login));

            //IModuleManager moduleManager = _container.Resolve<IModuleManager>();
            //moduleManager.LoadModule("MenuBarModule"); 


        }

        //private void ShowDialogUser(string user)
        //{

        //}
    }
}
